import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router/index.js'
import './ai-chat-plugin.js'
const app =createApp(App);


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// 注册全局日期格式化过滤器
app.config.globalProperties.$filters = {
    formatChineseDate(value) {
        if (!value) return ''
        const date = new Date(value)
        return format(date, 'yyyy年MM月dd日 HH:mm:ss', { locale: zhCN })
    }
}
app.use(router);
app.use(ElementPlus);
app.mount('#app')